package com.jack.xiaoer.dto;

import java.util.List;

/**
 * Created by Jackaroo Zhang on 2018/12/10.
 */
public class FileUploadDTO {

    private int total;

    private int failCount;

    private int successCount;

    private List<FileDTO> failFiles;

    private List<FileDTO> successFiles;

    public Integer getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getFailCount() {
        return failCount;
    }

    public void setFailCount(int failCount) {
        this.failCount = failCount;
        this.total = this.successCount + this.failCount;
    }

    public int getSuccessCount() {
        return successCount;
    }

    public void setSuccessCount(int successCount) {
        this.successCount = successCount;
        this.total = this.successCount + this.failCount;
    }

    public List<FileDTO> getFailFiles() {
        return failFiles;
    }

    public void setFailFiles(List<FileDTO> failFiles) {
        this.failFiles = failFiles;
        setFailCount(failFiles.size());
    }

    public List<FileDTO> getSuccessFiles() {
        return successFiles;
    }

    public void setSuccessFiles(List<FileDTO> successFiles) {
        this.successFiles = successFiles;
        setSuccessCount(successFiles.size());
    }

    @Override
    public String toString() {
        return "FileUploadDTO{" +
                "total=" + total +
                ", failCount=" + failCount +
                ", successCount=" + successCount +
                ", failFiles=" + failFiles +
                ", successFiles=" + successFiles +
                '}';
    }
}
